import { message, notification } from 'antd';
import { getMailOptionPrice } from '../../../../services/foreignExchange_service';

export default {
  namespace: 'foreignQuote',
  state: {},

  effects: {
    *GetMailOptionPrice({ payload, callback }, { call, put }) {
      const response = yield call(getMailOptionPrice, payload);
      if (typeof response === 'undefined') {
        return;
      }
      if (typeof response !== 'undefined' && response.code === 1) {
        // message.success(response.message);
        if (callback) callback(response);
      } else {
        notification.error({
          message: typeof response.message !== 'undefined' ? response.message : '请求错误',
        });
      }
    },
  },

  reducers: {
    // saveStocks(state, action) {
    //   return {
    //     ...state,
    //     stocks: action.payload.data,
    //     stocksFilters: action.payload.filter,
    //   };
    // },
  },
};
